<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
</head>

<body>
    <div id="fileEdit"></div>
    <style>
        body {
            margin: 0;
            padding: 0;
            height: 100vh;
        }

        #fileEdit {
            width: 100%;
            height: 100vh;
        }
    </style>
    <!-- 页面引入ONLYOFFICE Server端的api.js -->
    <script type="text/javascript" src="http://10.8.9.169:8080/web-apps/apps/api/documents/api.js"></script>
    <script>

    var config = {
            "documentType": "word",
            "historyList": {
                "history": [],
                "currentVersion": "1"
            },
            "document": {
                "title": "测试文件.docx",
                "url": "https://d2nlctn12v279m.cloudfront.net/assets/docs/samples/zh/demo.docx",
                "permissions": {
                    "print": true,
                    "download": true
                },
                "attachId": "e932e7bb1e4d449aa9a7d82b403b4b517",
                "key": "e932e7bb1e4d449aa9a7d8ss512117",
                "fileType": "docx",
            },
            "editorConfig": {
                "customization": {
                    "autosave": false,
                    "compactToolbar": true,
                    "forcesave": true,
                    "toolbarNoTabs": true,
                    "help": false,
                    "compactHeader": true,
                    "hideRightMenu": true,
                },
                "mode": "edit",
                // "callbackUrl": "https://www.onlyoffice.com:443/callback.ashx?from=office-suite",
                "lang": "zh-CN",
                "user": {
                    "name": "当前用户",
                    "id": "103"
                }
            }
        };


        /*
        ONLYOFFICE编辑器有三种主要外观，针对不同用途进行了优化,可通过type属性予以配置：
          desktop，针对桌面计算机浏览器中的显示进行了优化；
          mobile，针对移动设备浏览器中的显示进行了优化；
          embedded，针对将文档嵌入网页进行了优化。
         */
        new DocsAPI.DocEditor("fileEdit", config);
    </script>
</body>

</html>